<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <!-- b7 -->
    <button id="btn">点我发送q</button>
    <!-- b2 -->
    <script>
      // b4 b6 b15
      function fn2(data) {
        console.log('xxx000')
        console.log(data)
      }

      function fn3(data) {
        console.log('fn3')
        console.log(data)
      }
      // b8
      let btn = document.getElementById('btn')
      btn.onclick = function () {
        // b9
        let script = document.createElement('script')
        script.src = 'http://localhost:3001/better?callback=fn2'
        // b10
        document.body.appendChild(script)
        // b11
        script.onload = function () {
          // 这里面是不是写this可以？
          document.body.removeChild(script)
        }
      }
    </script>
    <!-- b1 -->
    <script src="http://localhost:3001/test"></script>
    <!-- b12 b15.1-->
    <script src="http://localhost:3001/better?callback=fn2"></script>
  </body>
</html>
